package com.jili.controller;

import com.jili.req.MailRequest;
import com.jili.service.SendMailService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ClassName: SendMailController
 * Package com.jili.controller
 * Description:
 *
 * @Author: 廖继礼
 * @Create: 2025/2/23
 * @Version: v1.0
 */
@RestController
@RequestMapping("/send-mail")
public class SendMailController {

    @Resource
    private SendMailService sendMailService;

    /**
     * 发送简单邮件
     *
     * @param mailRequest
     */

    @PostMapping("/simple")
    public void SendSimpleMessage(@RequestBody MailRequest mailRequest) {
        sendMailService.sendSimpleMail(mailRequest);
    }

    @PostMapping("/html")
    public void sendHtmlMessage(@RequestBody MailRequest mailRequest) {
        sendMailService.sendHtmlMail(mailRequest);
    }
}
